﻿/***********************************************************************************//*
*  作者: 邹杭特                                                                       *
*  时间: 2021-04-24                                                                   *
*  版本: master_b9fdd5                                                                *
*  功能:                                                                              *
*   - 绑定模板                                                                        *
*//************************************************************************************/

using System;
using UnityEngine;
using UnityEngine.EventSystems;

namespace BridgeUI.Binding
{
    public abstract class BindingReference : UIBehaviour, IClassReference
    {
        [SerializeField]
        protected string typeFullName;
        public Type LoadScriptType()
        {
            var viewScriptType = BridgeUI.Utility.GameAssembly.GetType(typeFullName);
            if (viewScriptType == null)
            {
                viewScriptType = BridgeUI.Utility.CurrAssembly.GetType(typeFullName);
            }
            if (viewScriptType != null)
            {
                return viewScriptType;
            }
            Debug.LogError("未编写脚本：" + typeFullName);
            return null;
        }
    }
    public abstract class BindingReference<T> : BindingReference
    {
        [SerializeField]
        protected T m_parameter;
    }
}